const Investor = require('./Investor');

/**
 * 散户投资者类
 * 特点：较低资本，行为更易受情绪影响
 */
class RetailInvestor extends Investor {
  /**
   * 创建散户投资者实例
   * @param {Object} config - 投资者配置
   */
  constructor(config = {}) {
    super({
      capital: config.capital || Math.random() * 10000, // 较低资本
      rationality: config.rationality !== undefined ? config.rationality : 0.5 + Math.random() * 0.3, // 理性程度偏低
      riskTolerance: config.riskTolerance || Math.random() * 0.5, // 风险容忍度偏低
      strategy: config.strategy || null,
      ...config
    });
  }
}

module.exports = RetailInvestor;